﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using CCF20Model;
using WiseLinkWPF.Windows.Controls.GridView;
using WiseLinkWPF.Windows.Controls;

namespace CCF20Module
{
    public class SMSTypeStyle : System.Windows.Controls.StyleSelector
    {
        public override Style SelectStyle(object item, DependencyObject container)
        {
            var cell = container as GridViewCell;
            var myColumn = cell.Column as GridViewDataColumn;
            string uniqueName = myColumn.UniqueName;

            if (item is SMSTemplate)
            {

                SMSTemplate smsTemplate = item as SMSTemplate;
                switch (uniqueName)
                {
                    case "短信类型":
                        if (smsTemplate.IsMonthly)
                        {
                            return MonthlyStyle;
                        }
                        else
                        {
                            return NormalStyle;
                        }
                        
                    
                }
            }
           
            return null;

        }
        public Style MonthlyStyle { get; set; }
        public Style NormalStyle { get; set; }
        

    }
}
